package com.cgbl.service.ui

import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route
import com.cgbl.service.BR
import com.cgbl.service.R
import com.cgbl.service.databinding.AppActivitySetRewardBinding
import com.cgbl.service.vm.SetRewardViewModel
import com.robot.base.base.activity.GLBaseActivity
import com.robot.base.configs.AppConstants
import com.robot.base.model.MemberAdapterBean
import com.robot.base.util.ToastUtils
import com.robot.base.util.arouter.ARouterUtil

@Route(path = AppConstants.Router.Project.A_SET_REWARD)
class SetRewardActivity : GLBaseActivity<AppActivitySetRewardBinding, SetRewardViewModel>() {

    override fun initContentView(savedInstanceState: Bundle?): Int =
        R.layout.app_activity_set_reward

    override fun initVariableId(): Int = BR.viewModel

    override fun initComponents() {
        addSingleTitleBar("设置酬劳")
        binding.tvNext.setOnClickListener {
            val reward = binding.etReward.text.toString()
            if (TextUtils.isEmpty(reward)) {
                ToastUtils.showShort("请输入酬劳!")
                return@setOnClickListener
            }
            val intent= Intent()
            intent.putExtra(AppConstants.BundleKey.REWARD_MONEY,reward)
            setResult(RESULT_OK,intent)
            finishActivity()
        }
    }

}